define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var status=$('#status').val();
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            if(status==2){
                Table.api.init({
                    extend: {
                        index_url: 'user/talents/index2',
                        multi_url: 'user/user/multi',
                        table: 'users',
                    }
                });
            }else{
                Table.api.init({
                    extend: {
                        index_url: 'user/talents/index',
                        multi_url: 'user/user/multi',
                        table: 'users',
                    }
                });
            }


            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'pay_see_id',
                sortName: 'pay_see_id',
                columns: [
                    [
                        {field: 'user_id', title: __('User_id')},
                        {field: 'user_name', title: __('User_name')},
                        {field: 'full_name', title: __('Full_name')},
                        {field: 'price', title: __('Price'),operate:false},
                        {field: 'create_time', title: __('Create_time'),operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'},
                        {field: 'startime', title: __('Start_time'),operate:false},
                        {field: 'endtime', title: __('End_time'),operate:false},
                    ]
                ],
                showToggle: false,
                showColumns: false,
                search:false,
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});